<%@page contentType="text/html; charset=UTF-8" language="java" %>
<%@page pageEncoding="UTF-8"%>
<%@ taglib uri="http://struts.apache.org/tags-html"  prefix="html"%>
<%@ taglib uri="http://struts.apache.org/tags-bean"  prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<%@ taglib uri="http://displaytag.sf.net" prefix="display" %>
<%@page import="com.kcs.common.utils.commonUtils"%>
<%@page import="com.kcs.common.utils.PropsUtils"%>
<%@page import="com.kcs.common.utils.Constant"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">  
<title>Config System</title>

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script>
<script type="text/javascript" src="jsp/script/jquery/plugin/fancybox/jquery.easing-1.3.pack.js"></script>
<script type="text/javascript" src="jsp/script/jquery/plugin/fancybox/jquery.fancybox-1.3.4.js"></script>
<script type="text/javascript" src="jsp/script/jquery/plugin/fancybox/jquery.fancybox-1.3.4.pack.js"></script>   
<script type="text/javascript" src="jsp/script/jsDatePick.full.1.3.js"></script>   	
<script type="text/javascript" src="jsp/script/common.js"></script>  
<link rel="stylesheet" type="text/css" href="jsp/script/jquery/plugin/fancybox/jquery.fancybox-1.3.4.css"/>
<link rel="stylesheet" type="text/css" href="jsp/css/table.css"/>
<link rel="stylesheet" type="text/css" href="jsp/css/jsDatePick_ltr.css" />
<link rel="stylesheet" type="text/css" href="jsp/css/fxmarginStyle.css"/>
<script type="text/javascript">

	$(document).ready(function() {
		jQuery("#action").val("init");
	});

	function save() {
		if(validate()){
			loading();
			jQuery("#action").val("save");
			submitform();
		}
	}

	function resetFunction() {
		loading();
		jQuery("#action").val("init");
		submitform();
	}

	function validate() {
		var returnStatement = true;
		
		jQuery("[name=configs]").each(
			function(){
				if(jQuery(this).val() == "") {returnStatement = false;}
			}
		);

		if(returnStatement == false) alert(m_please_fill_data ); 

		return returnStatement;
	}

	
</script>
</head>
<body>

<%@ include	file="include/headerMenu.jsp"%>

<center>
	<div style="width:95%" align="center">
		<html:form action="/ConfigSystemAction.do">
			<html:hidden property="action" styleId="action"/>
			
			<table width="100%" class="MarginHeader">
				<tr>
					<td align="left">Config System</td>
				</tr>
			</table>
			
			<div class="MarginTable" style="width: 60%;">
				<table align="center">
					<tr>
						<th width="100%" align="left" style="text-align: left;" colspan="2">Config</th>
					</tr>
					
					<logic:iterate id="configSystem" name="ConfigSystemActionForm" property="configList">
						<tr>
							<td width="50%" align="left" ><bean:write name="configSystem" property="keys"/></td>
							<td width="50%" align="right"><input type="text" name="configs" maxlength="100" style="width: 400px" value='<bean:write name="configSystem" property="value"/>' /></td>
						</tr>
					</logic:iterate>
				
				</table>
			</div>
			
			<table width="100%">
				<tr>
					<td width="50%" align="center"><input type="button" class="button" value="Save" onclick="save();"/></td>
					<td width="50%" align="center"><input type="button" class="button" value="Reset" onclick="resetFunction();"/></td>
				</tr>
			</table>
			
		
			<%@ include	file="include/footer.jsp"%> 
			<%@ include	file="include/message.jsp"%> 
			
		</html:form>	
		
	</div>
</center>

</body>
</html>